home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form Form1 BorderStyle = 1 'Fixed Single Caption = "Stick of Joy" Height = 3240 Icon = JSTICK.FRX:0000 Left = 1080 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 2865 ScaleWidth = 3270 Top = 1680 Width = 3360 Begin Timer Timer2 Interval = 1000 Left = 0 Top = 240 End Begin PictureBox Picture1 Height = 495 Index = 2 Left = 2760 Picture = JSTICK.FRX:0302 ScaleHeight = 465 ScaleWidth = 465 TabIndex = 15 Top = 1680 Visible = 0 'False Width = 495 End Begin PictureBox Picture1 Height = 495 Index = 1 Left = 2760 Picture = JSTICK.FRX:0604 ScaleHeight = 465 ScaleWidth = 465 TabIndex = 14 Top = 2040 Visible = 0 'False Width = 495 End Begin PictureBox Picture1 Height = 495 Index = 0 Left = 2760 Picture = JSTICK.FRX:0906 ScaleHeight = 465 ScaleWidth = 465 TabIndex = 13 Top = 2280 Visible = 0 'False Width = 495 End Begin Frame Frame2 Caption = "Reading" Height = 855 Left = 1680 TabIndex = 8 Top = 720 Width = 1335 Begin OptionButton Option4 Caption = "BIOS" Height = 255 Left = 120 TabIndex = 10 Top = 480 Width = 1095 End Begin OptionButton Option3 Caption = "Hardware" Height = 255 Left = 120 TabIndex = 9 Top = 240 Value = -1 'True Width = 1095 End End Begin Frame Frame1 Caption = " Joystick selection" Height = 615 Left = 120 TabIndex = 5 Top = 0 Width = 3015 Begin OptionButton Option2 Caption = "Number 2" Height = 255 Left = 1560 TabIndex = 7 Top = 240 Width = 1335 End Begin OptionButton Option1 Caption = "Number 1" Height = 255 Left = 120 TabIndex = 6 Top = 240 Value = -1 'True Width = 1215 End End Begin CommandButton Command1 Cancel = -1 'True Caption = "&Exit" Default = -1 'True Height = 375 Left = 2040 TabIndex = 4 Top = 2400 Width = 735 End Begin CheckBox button2_j1_hard Caption = "Button #2" Height = 255 Left = 1680 TabIndex = 2 Top = 2040 Width = 255 End Begin CheckBox button1_j1_hard Caption = "Button #1" Height = 255 Left = 1680 TabIndex = 1 Top = 1800 Width = 255 End Begin PictureBox crosshair BorderStyle = 0 'None Enabled = 0 'False Height = 420 Left = 0 Picture = JSTICK.FRX:0C08 ScaleHeight = 420 ScaleWidth = 420 TabIndex = 0 Top = 1080 Width = 420 End Begin Timer Timer1 Interval = 100 Left = 0 Top = 1560 End Begin Label Label2 Caption = "Button #2" Height = 255 Left = 1920 TabIndex = 12 Top = 2040 Width = 1215 End Begin Label Label1 Caption = "Button #1" Height = 255 Left = 1920 TabIndex = 11 Top = 1800 Width = 1095 End Begin Label Label3 Caption = "Label3" Height = 255 Left = 240 TabIndex = 3 Top = 2520 Width = 1335 End Begin Shape Shape1 BorderWidth = 3 Height = 1455 Left = 120 Shape = 4 'Rounded Rectangle Top = 960 Width = 1455 End Option Explicit Declare Function jstick Lib "JSTICK.DLL" Alias "#2" (ByVal method As Integer, ByVal jstick_num As Integer, xcord As Integer, ycord As Integer, but1 As Integer, but2 As Integer) As Integer Dim xcord As Integer Dim ycord As Integer Dim but1 As Integer Dim but2 As Integer Dim method As Integer Dim joystick As Integer Sub Command1_Click () End End Sub Sub Form_Load () joystick = 1 method = 0 End Sub Sub Option1_Click () If option1.Value = True Then joystick = 1 End Sub Sub Option2_Click () If option2.Value = True Then joystick = 2 End Sub Sub Option3_Click () If option3.Value = True Then method = 0 End Sub Sub Option4_Click () If option4.Value = True Then method = 1 End Sub Sub Timer1_Timer () 'If window is open then do joystick routine If form1.WindowState = 0 Then 'Read joystick settings using jstick call to DLL If jstick(method, joystick, xcord, ycord, but1, but2) Then 'Show returned x & y coordinates label3.Caption = "X:" + LTrim(Str(xcord)) + " Y:" + LTrim(Str(ycord)) 'Set coordinates for near center for joystick 1 & hardware xcord = xcord * 2 ycord = ycord * 2.4 'Keep crosshare on target area If xcord > shape1.Width - shape1.Left Then xcord = shape1.Width - shape1.Left - 200 If ycord > shape1.Height + shape1.Top Then ycord = shape1.Height - shape1.Top - 200 'Move crosshare to new values crosshair.Left = shape1.Left + xcord crosshair.Top = shape1.Top + ycord 'show buttons being pushed button1_j1_hard.Value = 1 - but1 button2_j1_hard.Value = 1 - but2 End If End If End Sub Sub Timer2_Timer () Static index As Integer 'If form minimized then change icon If form1.WindowState = 1 Then If index > 2 Then index = 0 'load icon that matches index form1.Icon = picture1(index).Picture index = index + 1 End If End Sub